<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8">

    <style type="text/css">

        body {
            font-family: Thoma, Microsoft YaHei, 'Lato', Calibri, Arial, sans-serif;
        }

        .loadBar {
            width: 99%;
            height: 22px;
            border: 1px solid #666;
            border-radius: 20px;
            position: relative;
        }

        .loadBar div {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
        }

        .loadBar div span, .loadBar div i {
            box-shadow: inset 0 -2px 6px rgba(0, 0, 0, .4);
            width: 0%;
            display: block;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            border-radius: 20px;
        }

        .loadBar div i {
            width: 100%;
            -webkit-animation: move .8s linear infinite;
            background: -webkit-linear-gradient(left top, #7ed047 0%, #7ed047 25%, #4ea018 25%, #4ea018 50%, #7ed047 50%, #7ed047 75%, #4ea018 75%, #4ea018 100%);
            background-size: 40px 40px;
        }

        .loadBar .percentNum {
            position: absolute;
            right: 5px;
        }

        @-webkit-keyframes move {
            0%
            {
                background-position: 0 0;
            }
            100%
            {
                background-position: 40px 0;
            }
        }
    </style>

    <script type="text/javascript" src="./lib/jquery-1.8.3.js"></script>

    <script type="text/javascript">

        function LoadingBar(id) {
            this.loadbar = $("#" + id);
            this.percentEle = $(".percent", this.loadbar);
            this.percentNumEle = $(".percentNum", this.loadbar);
            this.max = 100;
            this.currentProgress = 0;
        }
        LoadingBar.prototype = {
            constructor: LoadingBar,
            setMax: function (maxVal) {
                this.max = maxVal;
            },
            setProgress: function (val) {
                if (val >= this.max) {
                    val = this.max;
                }
                this.currentProgress = parseInt((val / this.max) * 100) + "%";
                this.percentEle.width(this.currentProgress);
                this.percentNumEle.text(this.currentProgress);
            }
        };

        $(function () {
            var loadbar = new LoadingBar("loadBar01");
            var max = 10000;
            loadbar.setMax(max);

            var i = 0;
            var time = setInterval(function () {
                loadbar.setProgress(i);
                if (i >= max) {
                    clearInterval(time);
                    return;
                }
                i += 10;
            }, 40);
        });

    </script>

</head>
<body>


<div>
    <div id="loadBar01" class="loadBar">
        <div>
             <span class="percent">
                <i></i>
             </span>
        </div>
        <span class="percentNum">0%</span>
    </div>
</div>

</body>
</html>